<?php session_start();ob_start(); ?>
<!DOCTYPE HTML>
<html>
<head>
<?php include "head.php";?>
<title>Trang quản lý website</title>
	
</head>
<body>

<div id="big">
<div id="main">

 <?php
	include"dbcon.php"; 
	$xxx = mysql_fetch_array( mysql_query("select tensp from sanpham where masp = 1"));
	echo "$xxx[0]";
	echo "<form action='XuLyThemDT.php' method = 'post'>";
	echo '<table  align="center" border="1">
		<tr align="center"> <td colspan = 2 > Nhập Điện Thoại Mới </td> </tr>
		<tr> <td> Nhập Tên Sản Phẩm : </td> <td> <input type = "text" name = "tbxTenSP" id = "tbxTenSP" > </td>
		</tr>
		<tr> <td> Nhập Mô tả : </td> <td>  <input type = "text" name = "tbxMoTa" id = "tbxMoTa" > </td>
		</tr>
		<tr>  <td> Nhập Giá : </td> <td> <input type = "text" name = "tbxGia" id = "tbxGia" > </td>
		</tr>
		<tr> <td> Nhập đường dẫn tới hình : </td> <td><input type = "text" name = "tbxUrl" id = "tbxUrl" > </td>
		</tr>
		<tr> <td> Nhập Số lần xem : </td> <td> <input type = "text" name = "tbxSLX" id = "tbxSLX" > </td>
		</tr>
		<tr> <td> Nhập Số lượng tồn kho : </td> <td> <input type = "text" name = "tbxSLTK" id = "tbxSLTK" > </td>
		</tr>
	</table>';
   $querys1 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd and dacdiem.madd = 1 ");
   $querys2 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 2 ");
   $querys3 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 3 ");
   $querys4 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 4 ");
   $querys5 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 5 ");
   $querys6 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 6 ");
   $querys7 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 7 ");
   $querys8 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 8 ");
   $querys9 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 9 ");
   $querys10 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 10 ");
   $querys11 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 11 ");
   $querys12 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 12 ");
   $querys13 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 13 ");
   $querys14 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 14 ");
   $querys15 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 15 ");
   $querys16 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 16 ");
   $querys17 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 17");
   $querys18 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 18 ");
   $querys19 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 19");
   $querys20 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 20 ");
   $querys21 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 21 ");
   $querys22 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 22 ");
   $querys23 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 23 ");
   $querys24 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 24 ");
   $querys25 = mysql_query("  select distinct chitietdd.tenct,chitietdd.mact from dacdiem,chitietdd,tskt where tskt.mact = chitietdd.mact and chitietdd.madd = dacdiem.madd   and dacdiem.madd = 25 ");
 	$t1 = "Hãng sản xuất";
	$t2 = "Mạng";
	$t3 = "Kiểu dáng";
	$t4 = "Kích thước";
	$t5 = "Trọng lượng";
	$t6 = "Màn hình";
	$t7 = "Độ phân giải màn hình";
	$t8 = "Thông báo";
	$t9 = "Rung";
	$t10 = "Loại thẻ nhớ";
	$t11 = "Bộ nhớ trong";
	$t12 = "Tin nhắn";
	$t13 = "GPRS";
	$t14 = "EDGE";
	$t15 = "Hỗ trợ 3G";
	$t16 = "Trình duyệt";
	$t17 = "Bluetooth";
	$t18 = "Wifi";
	$t19 = "Cổng USB";
	$t20 = "Camera";
	$t21 = "Màu";
	$t22 = "Hệ điều hành";
	$t23 = "Pin";
	$t24 = "Thời gian đàm thoại";
	$t25 = "Thời gian chờ";
	
	$ts1 = "HSX";
	$ts2 = "Mang";
	$ts3 = "KD";
	$ts4 = "KT";
	$ts5 = "TL";
	$ts6 = "MH";
	$ts7 = "DPG";
	$ts8 = "TB";
	$ts9 = "R";
	$ts10 = "LTN";
	$ts11 = "BNT";
	$ts12 = "SMS";
	$ts13 = "GPRS";
	$ts14 = "EDGE";
	$ts15 = "3G";
	$ts16 = "TD";
	$ts17 = "Blue";
	$ts18 = "W";
	$ts19 = "USB";
	$ts20 = "Cam";
	$ts21 = "Mau";
	$ts22 = "HDH";
	$ts23 = "Pin";
	$ts24 = "TGDT";
	$ts25 = "TGC";
	echo "</br>";
    echo "<div id='chitiet2'>";
			   echo "<table align='center' border='1' style=' border-collapse: collapse ' ";
			   echo "<tr>";
			   echo "<td colspan='2' align='center'style=' padding: 5px 5px'> THÊM CHI TIẾT CHO SẢN PHẨM </td>";
			   echo " </tr>";
			   for ($i = 1 ; $i< 26 ; $i++)
			   {
				   $t = "t$i";
				   $ts = "ts$i";
				   $k = $$t;
				     $ks = $$ts;
			   echo "<tr>";
			   echo "<td align='left' width='200px' style=' padding: 5px 5px '> $k </td> ";
			   echo "<td width='300px' style=' padding: 5px 5px '>";
			   $hh = "querys$i";
			   $hhh = $$hh;
			    echo"<select name = '$ks' id = '$ks'>";
    while($rows1=mysql_fetch_array($hhh))
	{
			  echo" <option value='$rows1[1]'> $rows1[0] </option> ";
	}
   	echo "</select>";
			   
			   	echo "</td>";
	echo"</tr>";
	
			   }
			   echo "<tr align='center'> <td colspan = 2> <input type = 'submit' name = 'ThemDT' value = 'Thêm Điện Thoại'";
	echo "</td> </tr>"; 
	echo "</table>";
	echo "</form>";
		echo "</div>";
		
?></div></div>
</body>
</html>
<?php
ob_end_flush();
?>

